<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="/static/index/css/amazeui.min.css">
    <link rel="stylesheet" href="/static/index/css/wap.css">
    <title>内容页</title>
</head>
<body style="background:#ececec">
<div class="pet_mian" >
    <div class="pet_head">
  <header data-am-widget="header"
          class="am-header am-header-default pet_head_block">
      <div class="am-header-left am-header-nav ">
          <a href="{:url('index/article/index')}" class="iconfont pet_head_jt_ico">&#xe601;</a>
      </div>

      <h1 class="am-header-title pet_article_user">
      <div class="pet_article_user_info_tab">
        <div class="pet_article_user_info_tab_font">
        <div class="pet_article_user_info_tab_font_triangle"></div>

        </div>
      </div>
      <span class="pet_article_user_name">作者@{$data.author}</span>
      </h1>

      <div class="am-header-right am-header-nav">
          <a href="{:url('index/index/index')}" class="iconfont pet_head_gd_ico">&#xe600;</a>
      </div>
  </header>
</div>

<div class="pet_content">
<div class="pet_content_block">
  <article data-am-widget="paragraph" class="am-paragraph am-paragraph-default pet_content_article" data-am-paragraph="{ tableScrollable: true, pureview: true }">

  <h1 class="pet_article_title">{$data.title}</h1>
  <div class="pet_article_user_time">发表于: {$data.time}</div>
  <div>{$data.matter}</div>
  </article>
    <div class="pet_article_dowload">
      <div class="pet_article_dowload_title">留下您的评论</div>
      <div class="pet_article_dowload_content"><div class="pet_article_dowload_triangle"></div>
      <div class="pet_article_dowload_ico"><img src="/static/index/img/footdon.png" alt=""></div>
      <form method="post"  action="{:url('index/article/comment')}" >

      <div class="pet_article_dowload_content_font">
      <input type="hidden" name="id" value="{$data.id}">
        <textarea name="comment" cols="83" rows="10" style="height:120px;padding-left: 0px;">
        </textarea>
      </div>
      <div class="pet_article_dowload_all">
       <button type="submit" class="pet_article_dowload_Pg am-icon-comment">
         提交
       </button>
      </div>
      </form>

      </div>
  </div>
</div>
<div class="pet_comment_list">
  <div class="pet_comment_list_wap"><div class="pet_comment_list_title">精彩评论</div>

  <div data-am-widget="tabs" class="am-tabs am-tabs-default pet_comment_list_tab" >
     <!--  <ul class="am-tabs-nav am-cf pet_comment_list_title_tab">
          <li class="am-active"><a href="[data-tab-panel-0]">人气</a></li>
          <li class=""><a href="[data-tab-panel-1]">最新</a></li>
          <li class=""><a href="[data-tab-panel-2]">最早</a></li>
      </ul> -->

      {volist name="result" id="v" }
      <div class="am-tabs-bd pet_pl_list">
          <div data-tab-panel-0 class="am-tab-panel am-active">
              <div class="pet_comment_list_block_l"><img src="/static/index/img/a1.png" alt=""></div>
              <div class="pet_comment_list_block_r">
                <div class="pet_comment_list_block_r_info">{$v[1]}</div>
                <div class="pet_comment_list_block_r_text">{$v.comment}</div>
                <div class="pet_comment_list_block_r_bottom">
                  <div class="pet_comment_list_bottom_info_l">{$v[0]}</div>

    {if condition="($v.uid) == ($Think.session.user_info.uid) "}
                  <div class="tpl-table-black-operation  sch" style="display: block">
                                                    <button style="border:none;" class="tpl-table-black-operation-del del" data-uid={$v.uid} data-cid={$v.id}>
                                                        <i class="am-icon-trash" ></i>删除
                                                    </button>
                    </div>
{else /}
<div></div>
{/if}

                  <div class="pet_comment_list_bottom_info_r">
                  <button style="border:none;" data-cid="{$v.id}"  data-uid="{$v.uid}" class="btn">
                      <i class="iconfont">&#xe631;</i>
                      <span class="span">{$v.zan}</span>
                   </button>

                  <span></span></div>
                </div>
              </div>
           {/volist}
          </div>
         
  </div>
  </div>
</div>

<div class="pet_article_footer_info">Copyright(c) 豫ICP备18011515号-1</div>
</div>

<script src="/static/index/js/jquery.min.js"></script>
<script src="/static/index/js/amazeui.min.js"></script>
<script>

$(function(){

    // 动态计算新闻列表文字样式
    auto_resize();
    $(window).resize(function() {
        auto_resize();
    });
    $('.am-list-thumb img').load(function(){
        auto_resize();
    });
    $('.pet_article_like li:last-child').css('border','none');
        function auto_resize(){
        $('.pet_list_one_nr').height($('.pet_list_one_img').height());
                // alert($('.pet_list_one_nr').height());
    }
        $('.pet_article_user').on('click',function(){
            if($('.pet_article_user_info_tab').hasClass('pet_article_user_info_tab_show')){
                $('.pet_article_user_info_tab').removeClass('pet_article_user_info_tab_show').addClass('pet_article_user_info_tab_cloes');
            }else{
                $('.pet_article_user_info_tab').removeClass('pet_article_user_info_tab_cloes').addClass('pet_article_user_info_tab_show');
            }
        });

        $('.pet_head_gd_ico').on('click',function(){
            $('.pet_more_list').addClass('pet_more_list_show');
       });
        $('.pet_more_close').on('click',function(){
            $('.pet_more_list').removeClass('pet_more_list_show');
        });
});


$(function(){

    var butlist = $('.btn');
    for(var i =0;i<butlist.length;i++){
          (function(i){
                    butlist[i].onclick = function(){
                        var cid = $(this).attr('data-cid');
                        var uid = $(this).attr('data-uid');
                        dianzanAjax(cid,uid,i);
                    }
               })(i);
    }

});

$(function(){
    $('.del').click(function(){
                        var thiss = $(this);
                        var cid = $(this).attr('data-cid');
                        var uid = $(this).attr('data-uid');
                        
                       
                        if(confirm('确定要[ 删除 ]吗')){
                          delAjax(cid,uid,thiss);

                        };
    })
});
  function  delAjax(id,uid,thiss)
  {
    $.ajax({
      url:"{:url('index/article/delete')}?id="+ id + "&uid=" + uid,
         type:'get',
         datetype:'JSON',
         success:function(data){
            if(data.status==1){
                alert('删除成功!');
                thiss.parent().parent().parent().parent().parent().remove();
                console.log(thiss.parentsUntil('.aaa'));
            }else{
                alert('删除失败!');
            }
         },
         error:function(){
          alert('AJax请求失败!')
         }
    })
  }
  
  function  dianzanAjax(id,uid,i)
  {
      $.ajax({
         url:"{:url('index/article/zan')}?id="+ id + "&uid=" + uid,
         type:'get',
         datetype:'JSON',
         success:function(data){
           if(data.status==1){
            window.location.href="{:url('index/login/login')}";
           }else if(data.status == 2){
            // console.log(data);
              $('.span').eq(i).html(data.msg);
           }else{
              $('.span').eq(i).html(data.msg);
           }

         },
         error:function(){
          alert('AJax请求失败!');
         }
      })
  }


</script>
</body>
</html>